package cc.minos.components.skins.icons
{
	import flash.display.Shape;
	
	/**
	 * ...
	 * @author Minos
	 */
	public class IconDecorator extends Skin
	{
		protected var skin:Skin;
		protected var icon:Shape = new Shape();
		
		public function IconDecorator( skin:Skin )
		{
			this.skin = skin;
			this.addChild( skin );
			this.setPostion( skin.x , skin.y );
			skin.setPostion( 0 , 0 );
			addChild( icon );
			super();
			_type = "iconDecorator";
		}
		
		override public function draw():void
		{
			icon.graphics.clear();
			if ( skin )
				skin.draw();
		}
		
		protected function get startX():Number
		{
			return skin ? ( skin.width * .5 ) : 0;
		}
		
		protected function get startY():Number
		{
			return skin ? ( skin.height * .5 ) : 0;
		}
	
	}

}